package array;

public class Main {

	public static void main(String[] args) {
		testArrayReference();
	}



	/**
	 * Validates that element within array object can be changed
	 * Prints "changed" after method is ran
	 */
	private static void testArrayReference() {
		String[] strAry = new String[1];
		strAry[0] = "initial";
		testAry(strAry);
		System.out.println(strAry[0]);
	}
	public static void testAry(String[] ary){
		// method create a new copy of pointer, elements can be changed via this new copy
		ary[0]= "changed";
		// assigning this new pointer to null does not affect the array object in original caller
		ary = null; 
	}
}
